Skip to content

Conversation

@mart-r
Copy link
Collaborator

@mart-r mart-r commented Sep 25, 2025

This PR adds back the functionality from v1 that added mappings to other ontologies to the output of get_entities.

This PR adds this back, but with a slightly differtent approach. I've opted to make this a config option that can be changed if / when needed, instead of an extra argument to the method(s).

@tomolopolis
Copy link
Member

@mart-r mart-r requested a review from baixiac September 25, 2025 15:32
Copy link
Member

@baixiac baixiac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks and LGTM. Minor comment added.

Comment on lines 546 to 550
if addl_info_name not in self.cdb.addl_info:
logger.debug(
"Trying to map to ontology '%s' but it is not set in "
"addl_info so unable to do so", ont)
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a configuration error or model error to me. Perhaps use a warning here too or raise an exception, as users may not have switched on the debug log?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original thought was that it's fine - if the default config defines something that doesn't exist, just ignore.

However, given that most base models will be created by us and we would expect this to be set correctly at creation time, I think you're right. Using a warning here makes more sense.

Copy link
Member

@tomolopolis tomolopolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - but if you can confirm the config prop that looks like its been removed.

map_cui_to_group: bool = False
"""If the cdb.addl_info['cui2group'] is provided and this option enabled,
each CUI will be mapped to the group"""
simple_hash: bool = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this config prop is now removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a relic from v1. It was never used in v2. v2 always used a faster hash than v1.

@mart-r mart-r merged commit 4c0495e into main Sep 29, 2025
20 checks passed
@mart-r mart-r deleted the CU-869aknekf-add-mapping-to-ontologies branch September 29, 2025 14:32
@mart-r mart-r mentioned this pull request Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants